import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const getList = (page, limit, params) => {
  return request({
    url: baseUrl + '/api/scheme/pages',
    method: 'get',
    params: {
      key:params.schemeName==undefined?'':params.schemeName,
      type:params.frmId==undefined?'':params.frmId,
      page,
      limit,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: baseUrl + '/api/scheme/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: baseUrl + '/api/scheme/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: baseUrl + '/api/scheme/add',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: baseUrl + '/api/scheme/edit',
    method: 'post',
    data: row
  })
}

export const formApp = () => {
  return request({
    url: baseUrl + '/api/misform/getlist',
    method: 'get'
  })
}